package com.heima.mapper;

import com.heima.vo.DeptVo;
import com.heima.vo.UserListVo;
import org.apache.ibatis.annotations.Mapper;

import java.math.BigDecimal;
import java.time.LocalDate;
import java.util.List;

@Mapper
public interface HomePageMapper {

    /**
     * 根据时间获取线索数量
     * @return
     */
    Integer getCluesNum(LocalDate beginCreateTime, LocalDate endCreateTime);

    /**
     * 根据时间获取商机数量
     * @param beginCreateTime
     * @param endCreateTime
     * @return
     */
    Integer getBusinessNum(LocalDate beginCreateTime, LocalDate endCreateTime);

    /**
     * 根据时间获取合同数量/客户数量
     * @param beginCreateTime
     * @param endCreateTime
     * @return
     */
    Integer getContractNum(LocalDate beginCreateTime, LocalDate endCreateTime);

    /**
     * 根据时间获取销售额
     * @param beginCreateTime
     * @param endCreateTime
     * @return
     */
    List<BigDecimal> getSalesAmount(LocalDate beginCreateTime, LocalDate endCreateTime);

    /**
     * 今日线索数量
     * @return
     */
    Integer getTodayCluesNum(LocalDate now);

    /**
     * 今日商机数量
     * @param now
     * @return
     */
    Integer getTodayBusinessNum(LocalDate now);

    /**
     * 今日合同数量
     * @param now
     * @return
     */
    Integer getTodayContractNum(LocalDate now);

    /**
     * 今日销售额
     * @param
     * @return
     */
    BigDecimal getTodaySalesAmount(LocalDate begin, LocalDate end);

    /**
     * 根据时间获取员工数据
     * @param beginCreateTime
     * @param endCreateTime
     * @return
     */
    List<UserListVo> getEmp(LocalDate beginCreateTime, LocalDate endCreateTime);

    /**
     * 根据部门id获取部门数据
     * @param deptId
     * @return
     */
    DeptVo getByDeptId(Integer deptId);

    /**
     * 获取有效线索数量
     * @param beginCreateTime
     * @param endCreateTime
     * @return
     */
    Integer getEffectiveCluesNum(LocalDate beginCreateTime, LocalDate endCreateTime);

    /**
     * 获取待跟进线索数量
     * @param beginCreateTime
     * @param endCreateTime
     * @return
     */
    Integer getTofollowedCluesNum(LocalDate beginCreateTime, LocalDate endCreateTime);

    /**
     * 获取待分配商机数量
     * @param beginCreateTime
     * @param endCreateTime
     * @return
     */
    Integer getTofollowedBusinessNum(LocalDate beginCreateTime, LocalDate endCreateTime);

    /**
     * 获取对应员工的商机数量
     * @param userId
     * @param beginCreateTime
     * @param endCreateTime
     * @return
     */
    Integer getByBusinessNum(Integer userId, LocalDate beginCreateTime, LocalDate endCreateTime);

    /**
     * 获取对应员工的合同数量
     * @param userId
     * @param beginCreateTime
     * @param endCreateTime
     * @return
     */
    Integer getByCotractNum(Integer userId, LocalDate beginCreateTime, LocalDate endCreateTime);

    /**
     * 获取对应员工的线索总数量
     * @param userId
     * @param beginCreateTime
     * @param endCreateTime
     * @return
     */
    Integer getTotalCluesNum(Integer userId, LocalDate beginCreateTime, LocalDate endCreateTime);
}
